package entity.DiscoverRecommend;

/**
 * Created by Administrator on 15-10-22.
 */

import org.json.JSONException;
import org.json.JSONObject;

import entity.Parsable;

/**
 * 一个听单数据实体
 */
public class SpecialItem implements Parsable{

    private int columnType;
    private long specialId;

    private String title;
    private String subtitle;

    private String footnote;
    private String coverPath;
    private String contentType;

    public int getColumnType() {
        return columnType;
    }

    public void setColumnType(int columnType) {
        this.columnType = columnType;
    }

    public String getContentType() {
        return contentType;
    }

    public void setContentType(String contentType) {
        this.contentType = contentType;
    }

    public String getSubtitle() {
        return subtitle;
    }

    public void setSubtitle(String subtitle) {
        this.subtitle = subtitle;
    }

    public long getSpecialId() {
        return specialId;
    }

    public void setSpecialId(long specialId) {
        this.specialId = specialId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getFootnote() {
        return footnote;
    }

    public void setFootnote(String footnote) {
        this.footnote = footnote;
    }

    public String getCoverPath() {
        return coverPath;
    }

    public void setCoverPath(String coverPath) {
        this.coverPath = coverPath;
    }

    public void parseJSON(JSONObject json) throws JSONException {
        /*
          "columnType": 1,
        "specialId": 348,
        "title": "5个如雷贯耳的脱口秀，高智商必听！",
        "subtitle": "人生不应该只有眼前的苟且，还有诗和远方！\r\n生活从来就不应该只有简单的吃饭穿衣，安身立命，人生除了温饱，还应该有另一个精神的高度，最终决定这个高度的，一定是眼界和见识，以及你碰到一个什么样的人生导师",
        "footnote": "5张专辑",
        "coverPath": "http://fdfs.xmcdn.com/group14/M04/4E/68/wKgDY1WyIl_jgde2AAG79hZ3Ml4209_mobile_small.jpg",
        "contentType": "1"
         */
        if(json!=null){
            specialId=json.getLong("specialId");
            title=json.getString("title");
            subtitle=json.getString("subtitle");
            columnType=json.optInt("columnType", 1);
            footnote=json.getString("footnote");
            coverPath=json.getString("coverPath");
            contentType=json.getString("contentType");

        }

    }
}
